"""
@File         : out.py
@Time         : 2024/05/06 15:55:56
@Author       : Qrj
@Email        : 923207736@qq.com
@Description  : 站内信模板的序列化模型
"""

from datetime import datetime

from pydantic import BaseModel, Field, TypeAdapter

from src.schemas.out import BaseOutSchemaConfigMixin


class StationMessageTemplateCompleteOutSchema(BaseModel, BaseOutSchemaConfigMixin):
    """站内信模板完整的序列化模型"""

    id: int = Field(default=..., description="主键")
    name: str = Field(default=..., description="模板名称")
    content: str = Field(default=..., description="模板内容")
    params: list[str] = Field(default=..., description="模板参数")
    is_init: bool = Field(default=..., description="是否初始模板")
    type: str = Field(default=..., description="模板类型")
    status: bool = Field(default=..., description="状态")
    show_order: int = Field(default=..., description="显示顺序")
    create_datetime: datetime = Field(default=..., description="创建时间")
    update_datetime: datetime = Field(default=..., description="修改时间")
    creator_username: str = Field(default=..., description="创建者用户名")
    updater_username: str = Field(default=..., description="修改者用户名")


# 完整信息的站内信模板序列化列表模型
ListStationMessageTemplateCompleteOutSchema = TypeAdapter(
    list[StationMessageTemplateCompleteOutSchema]
)
